User talk:Dammej/Sandbox/TestClassPage
Final Version I didn't look at the code too closely, but the template call looks fantastic :) two thumbs up !! I think this is ready for production. Regarding the layout: I'll let others comment, its not really my best field, but I do like what I see. --silverstrike 01:30, June 4, 2010 (UTC) :I agree coempletly. It seems sound, and works well. Once it is implemented, I think it will work great on the class and squadmate pages. The reason I didn't take part in the design process, is becuse you two went way over my head after about two hours. Again overall it looks great. Lancer1289 01:33, June 4, 2010 (UTC) ::Yup yup. It looks very nice. SpartHawg948 02:10, June 4, 2010 (UTC) :::Great and nice work! :) Teugene 03:13, June 4, 2010 (UTC) Template Replacement Looks good, and if it works, it will work good. However a new name would be good. However that is another issur that I will put below. Overall, it works, and it will do nicely to replace the current ones. Lancer1289 20:22, June 1, 2010 (UTC) :Ok since I have no idea what silverstike ment, I think that a power thing for each page, would just be too much work. And if it comes to that, then why don't we just use the current four templates rather than hardcoding everything. Lancer1289 20:33, June 1, 2010 (UTC) Name ClassPowers would really only work for ME2, as they are called talents in ME. Personally TalentsPowers would work, however I'd like more opinions. Lancer1289 20:22, June 1, 2010 (UTC) :Yeah, the name currently there is obviously temporary. TalentPowers will probably work, since the current direction of the discussion leads me to believe that the template won't be used directly, but as a "sub-call" from a more specific template. Dammej 20:31, June 1, 2010 (UTC) Template parameters (Continued discussion from Lancer1289 talk page) In order to simplify templates we should consider limiting the required parameter as much as possible. For example: Pseudo template: Pseudo template with limited parameters: The second example calculate the class image based on the class parameter value. It also simplifies defining of the powers - Instead of using "power1, power2, etc." we can use one parameter and defining values as CSV (comma separated values) for example: "powers_parameter=power1,power2,power3". --silverstrike 20:38, June 1, 2010 (UTC) :Forgive me for being a newbie to this, but I'm not entirely sure how I would write the template to do that. :) I could easily make it set the class image based on the class parameter (I think), and I imagine I could retrieve a power image based on the power name, but this presents some conflicting problems, I think: :*If I get the class name "Quarian Mechanist," should I display the ME achievement image or the ME2 achievement image? :*If I get the class name "Adept", do I display the ME adept image, or the ME2 adept image? :*If I see the power "Singularity", do I fetch the ME talent image, or the ME2 power image? :*Unrelated to the conflicts between ME/ME2, How does one enter the comment "Requires level x of other talent to unlock", since this differs depending on the classes. I suppose I could again check the class parameter to do this, but that's making the code a lot more complex. :I also don't currently know how I'd go about parsing out each power from the CSV list, but I think I could look that up. :One possible solution to the ME/ME2 differentiation is to simply make two more templates, I.E. Template:Talents and Template:Powers, which takes parameters as you stated above. Let me know your thoughts. Dammej 20:50, June 1, 2010 (UTC) ::We can do something like: } | } ... }} | } ... }} }} ::We first check the "1" parameter for the game (ME, ME2, and later ME3). We then check again for the power/talent. Now, if we use one parameter for powers, we will need to use the "#explode" function to split the string and create an array for each power specified. It's simpler then it looks. --silverstrike 21:16, June 1, 2010 (UTC) :::Hmm, yes, that makes sense. But it also occurs to me that powers won't change for each class, so why not just specify the class, then set everything about that class (including its powers) in the switch? Dammej 21:22, June 1, 2010 (UTC) ::::I agree, that would of been my choice. Unfortunately, I don't think that far ahead when it's just a discussion :p. --silverstrike 21:32, June 1, 2010 (UTC) :::::I'm messing with the templates now, so I think I understand it. I kinda want two templates though, to avoid the issue of duplicate code again. One template would simply take the parameters and format the table (pretty much what I have now), and this new template would be used to take the input of the game, and the class, the pass the appropriate parameters to the "formatting" template. Sound good? Better solution that I'm not aware of? Dammej 21:44, June 1, 2010 (UTC) I've been thinking a little more about it, and it seems to me like a power list would probably be better, since specifying powers for each class would have more "duplicate code" issues. Something that would make the template work significantly easier would be if the images had some sort of standard naming scheme, so I wouldn't have to do a switch like this: } |Singularity = |Lift = ... }} But instead, if I knew that a power/talent named Singularity for sure had its power image at Singularity.jpg, then I could just do this: } }} So it'd be completely general in that manner. This still hides the issue of "what if there are requirements for the power," however. :\ Dammej 22:11, June 1, 2010 (UTC) Deleting everything to do with that new "fewer parameters" template. The amount of logic required to determine the correct images, descriptions, etc, seems far too daunting for me to tackle. If someone else wants to try, go ahead. Dammej 00:11, June 2, 2010 (UTC) :I was hoping I could "borrow" your template to test in my sandbox Vanguard. It looks pretty neat for the work you done so far before you scrapped it... Teugene 02:42, June 2, 2010 (UTC) ::You talking about the ClassPowersNew template or the Powers template that I actually deleted? Guess the answer doesn't matter, since you're welcome to give it a go with whichever you want. I just can't think of a way to reduce the number of parameters without making the template enormous. Hope you have more luck! Dammej 02:47, June 2, 2010 (UTC) :::I was referring to the new global template you were working on. I think it's the ClassPowersNew. I would like to expand on your template, but I need some documentation or guide on how to use wiki markup language. 03:10, June 2, 2010 (UTC) ::::Oh, well that one I was still working on. I think it's pretty much done, as far as logic is concerned. TestClassPage has examples of all 4 uses. As far as improving the look of the template... I haven't touched that. ::::A great resource for help is, not suprisingly, here. Here's a direct link to the page on templates: http://help.wikia.com/wiki/Templates. Down in the "advanced templates" section, there's some links about template parameters and parser functions. Those are what I went off of to get the current state of this template, which is used on the page that this discussion is centered around. Dammej 03:18, June 2, 2010 (UTC) :::::Ah... okay I thought you scrapped that too. If that's the case, I do not need to redo what good work you've already done on the template then! Teugene 07:47, June 2, 2010 (UTC) I take a good hard look around to find any useful functions but reached dead end. It's too bad this wiki does not have the LoopFunctions and ForEachFunction extensions installed. I think those will greatly help you or any editor to generate a dynamic table. Teugene 09:50, June 2, 2010 (UTC) :Alas, the wiki system is not really suitable for advanced scripting. :RE: Images based on powers/abilities specified, we can use the template that is in use with the template - with a minor change we can implement it here. This way we make the code reusable, which is always a good thing. :RE: Specifying class or powers/abilities, I'll leave the decision up to you. We can go either way (or both). --silverstrike 10:51, June 2, 2010 (UTC) ::Hmm. I could find absolutely no help on the explode function on the help wikia. Seeing it used somewhere will help significantly, thank you. I can't believe that someone took the time to make a giant list like that. That was the thing that I was dreading most! Given this information, I might take another crack at reducing the parameters. Dammej 16:46, June 2, 2010 (UTC) :::The MediaWiki documentation is appalling at best. I am planning on writing some support templates for the wiki (like ) to limit the redundancy of repeating code, and the use of redundant parameters. :::RE: the AdversariesPowers template: notice that the template also has auto-categorization into the relevant biotics/tech categories and that the image size is hardcoded. I think we should add another optional parameter to that template for the image size with the current default value. --silverstrike 18:03, June 2, 2010 (UTC) ::::Yes, this is what I was thinking. An optional "game" parameter will also allow us to vary the image based on which game the "caller" wants. Defaulting to ME2 should make it so that any current users of the template won't break. I don't think any other changes would be needed to that particular template. Other than, potentially, its name, since it would no longer apply only to adversaries. Dammej 18:19, June 2, 2010 (UTC) Oh wow, I just got it working (at least in Tali's case) That was a lot of if statements. Thanks so much for the support and advice, especially from Silverstrike. Feel free to take a look at the two templates (Linked as PowersDetail and Powers) and offer any advice as to how I could further improve things. I'll continue to make tests in the coming days, but I'm inclined to believe that most of the major logic is sound. Thanks again, everyone. Dammej 02:45, June 3, 2010 (UTC) Other Comments Since I still believe that what I have right now as a "universal" template is still an improvement, I was hoping there could be discussion in that direction. Good idea? Bad idea? Things that could be improved? Dammej 00:11, June 2, 2010 (UTC) :I'll just say I'm all for uniformity in this sort of thing, so any step in that direction will be viewed favorably by me. And I do like what I see here. SpartHawg948 05:47, June 2, 2010 (UTC) ::I like the templates so far! Just wanna note that I'm seeing slightly different things on Firefox3.6 and IE8. I assume the version I see in Chrome is accurate. ::# In Firefox, for the ME2 Squadmate and ME2 Class, the bottom line is not extended to same length as the top line. ::# In IE8, all the lines separating the powers are not seen. :: :::Hmm, that's annoying. It looked fine in IE7, so I thought I'd just have to mangle FF into place. Argh. Now I'll have to download IE8 :\. Thanks for the heads up! You wouldn't happen to know what causes that would you? :) Dammej 07:56, June 2, 2010 (UTC) :::Actually, scratch that. I do in fact already have IE8 installed, which is where I saw that it looked the same as chrome. Very strange. You sure you have IE8? What OS is this on? Dammej 08:02, June 2, 2010 (UTC) :::Argh, sorry for the 3rd edit. I just tried "compatibility view" on the page, where I witnessed the disappearing lines for myself. Maybe you're running it in compatibility view as well? Dammej 08:03, June 2, 2010 (UTC) ::::(edit conflict) I will take a look at the CSS and see if I could figure out anything. It's annoying when different browsers has different implementation... One of the most annoying things a web developer/designer could ever face :/ And I think you should continue to use IE7 so you still test if it's still showing correctly while I can inform you if IE8 is showing correctly. ::::I'm not using compatibility view. I'm kinda against using compatibility view because it is basically causing IE to render in an IE6 or lower versions. If I'm not wrong, the default settings in IE7+ for compatibility are disabled and the code should work around that.. Teugene 08:07, June 2, 2010 (UTC) ::::Wait my bad. Although I do not have this wikia or any website in compatibility view, apparently IE automatically retrieve a list "compatible" websites. I unchecked it and IE8 shows fine. But like I said above, most people will have the that as the default setting. So I believe we should work around that. Teugene 08:11, June 2, 2010 (UTC) :::::Oh good. When the same browser renders differently on different computers, you know you have a big problem. Glad we won't have to worry about that. I kinda agree about making it work on compat mode, as much as it pains me. I'll keep pouring over the styles to try some things... I know exactly what you mean about CSS. I recently had to make a website that rendered correctly all the way down to IE6. It was... well, awful. So many hacks... Dammej 08:16, June 2, 2010 (UTC) ::::::I share your sentiments...! I used to spend hours cracking HTML/CSS fixes for IE6.. darn browser! sigh... Teugene 08:26, June 2, 2010 (UTC) I forgot to mention it when I made the change (been busy), but I believe I've got the table rendering consistently across all 3 browsers. I did this at the sacrifice of the neat borders that encompass the class image, but I think it still looks OK without them. What do others think? Dammej 00:01, June 3, 2010 (UTC) :Looks nice! As for the sacrificing the borders, have you tried nesting a table inside another table with two columns that would handle the outer border? Something simple such as: | image |} :That's the gist of it. I'm not sure if that even works as I'm a little busy at the moment and didn't have time to check the template yet.. Teugene 03:34, June 3, 2010 (UTC) ::Tables already make me want to cry, and nesting them will probably kill me, but I'll try it out and see how it looks. Dammej 05:23, June 3, 2010 (UTC) :::After an idiotic error on my part ( : is not the same as = ), I was able to do that and have it work. Hooray consistency! Thanks for the suggestion. It even sort-of cleaned up the template! Huzzah! Dammej 07:42, June 3, 2010 (UTC)